import CategoryModel from '../models/category.model';
import { ObjectType } from '../types';
import {BaseInsertDto, BaseUpdateDto} from './.dto';

/** 类别列表DTO */
export class CategoryListDto implements ObjectType, Partial<CategoryModel> {
  id: string = '';
  code: string = '';
  isVisible: boolean = false;
  level: number = 0;
  name: string = '';
  parentId: string = '';
  sortOrder: number = 0;
}

/** 类别单个DTO */
export class CategorySingleDto implements ObjectType, Partial<CategoryModel> {
  id: string = '';
  code: string = '';
  isVisible: boolean = false;
  level: number = 0;
  name: string = '';
  parentId: string = '';
  sortOrder: number = 0;
}

/** 类别创建DTO */
export class CategoryCreateDto extends BaseInsertDto implements Partial<CategoryModel> {
  code: string = '';
  isVisible: boolean = false;
  level: number = 0;
  name: string = '';
  parentId: string = '';
  sortOrder: number = 0;
}

/** 类别更新DTO */
export class CategoryUpdateDto extends BaseUpdateDto implements Partial<CategoryModel> {
  code: string = '';
  isVisible: boolean = false;
  level: number = 0;
  name: string = '';
  parentId: string = '';
  sortOrder: number = 0;
}

/**
 * @swagger
 * components:
 *   schemas:
 *     CategoryListDto:
 *       type: object
 *       properties:
 *         id:
 *           type: integer
 *           description: 类别的唯一标识符
 *           example: 1
 *         code:
 *           type: string
 *           description: 类别编码，唯一标识类别的字符串
 *           example: 'CATEGORY_A'
 *         isVisible:
 *           type: boolean
 *           description: 是否显示，指示类别是否在前端可见
 *           example: true
 *         level:
 *           type: integer
 *           description: 类别层级，表示类别的层级关系
 *           example: 1
 *         name:
 *           type: string
 *           description: 类别名称，描述类别的基本信息
 *           example: '电子产品'
 *         parentId:
 *           type: integer
 *           description: 父类别ID，指向上级类别的唯一标识符
 *           example: 0
 *         sortOrder:
 *           type: integer
 *           description: 排序号，指示类别的显示顺序
 *           example: 1
 *     CategorySingleDto:
 *       allOf:
 *         - $ref: '#/components/schemas/CategoryListDto'
 *     CategoryCreateDto:
 *       type: object
 *       properties:
 *         code:
 *           type: string
 *           description: 类别编码，唯一标识类别的字符串
 *           example: 'CATEGORY_A'
 *         isVisible:
 *           type: boolean
 *           description: 是否显示，指示类别是否在前端可见
 *           example: true
 *         level:
 *           type: integer
 *           description: 类别层级，表示类别的层级关系
 *           example: 1
 *         name:
 *           type: string
 *           description: 类别名称，描述类别的基本信息
 *           example: '电子产品'
 *         parentId:
 *           type: integer
 *           description: 父类别ID，指向上级类别的唯一标识符
 *           example: 0
 *         sortOrder:
 *           type: integer
 *           description: 排序号，指示类别的显示顺序
 *           example: 1
 *     CategoryUpdateDto:
 *       type: object
 *       properties:
 *         code:
 *           type: string
 *           description: 类别编码，唯一标识类别的字符串
 *           example: 'CATEGORY_A'
 *         isVisible:
 *           type: boolean
 *           description: 是否显示，指示类别是否在前端可见
 *           example: true
 *         level:
 *           type: integer
 *           description: 类别层级，表示类别的层级关系
 *           example: 1
 *         name:
 *           type: string
 *           description: 类别名称，描述类别的基本信息
 *           example: '电子产品'
 *         parentId:
 *           type: integer
 *           description: 父类别ID，指向上级类别的唯一标识符
 *           example: 0
 *         sortOrder:
 *           type: integer
 *           description: 排序号，指示类别的显示顺序
 *           example: 1
 */
